<div class="col-md-12 col-sm-12 col-xs-12">
  <div class="x_panel">
    <div class="x_title">
      <h2>{$pri_name} <small></small></h2>
      <div class="clearfix"></div>
    </div>
    <div class="x_content">

      <form class="form-horizontal form-label-left" novalidate action="" id="commentForm" method="post" enctype="multipart/form-data">

        <p><code>备注:</code>图标链接请点击此网站 <a href="http://www.fontawesome.com.cn/faicons/" target="_blank"><code>图标样式</code></a>!
        </p>
        <!--<span class="section">Personal Info</span>-->
        <div class="item form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="parent_id">权限分类 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
            <select name="parent_id" class="single_select form-control" id="parent_id" style="width: 100%;">
              <option value="0">| -- 顶级分类</option>
              {volist name="list" id="item"}
              <option value="{$item.id}" {eq name="item.id" value="$info.parent_id|default=''"}selected{/eq}>{php}echo str_repeat('&nbsp&nbsp&nbsp',$item['level']-1)."| -- ".$item['pri_name']{/php}</option>
              {/volist}
            </select>
          </div>
        </div>
        <!--<div class="item form-group">-->
        <!--<label class="control-label col-md-3 col-sm-3 col-xs-12" for="parent_id">权限分类 <span class="required">*</span>-->
        <!--</label>-->
        <!--<div class="col-md-6 col-sm-6 col-xs-12">-->
        <!--<select name="parent_id" class="multi_select form-control" multiple="multiple" style="width: 100%;">-->
        <!--<option value="0">| &#45;&#45; 顶级分类</option>-->
        <!--{volist name="list" id="item"}-->
        <!--<option value="{$item.id}" {eq name="item.id" value="$info.parent_id|default=''"}selected{/eq}>{php}echo str_repeat('&nbsp&nbsp&nbsp',$item['level']-1)."| &#45;&#45; ".$item['pri_name']{/php}</option>-->
        <!--{/volist}-->
        <!--</select>-->
        <!--</div>-->
        <!--</div>-->

        <div class="item form-group" >
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="pri_name">权限名称 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12 ">
            <input type="text" id="pri_name" name="pri_name" value="{$info.pri_name|default=''}" minlength="2" required class="form-control col-md-7 col-xs-12" placeholder="">
          </div>
        </div>
        <div class="item form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="icon">权限图标 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12 ">
            <input type="text" id="icon" name="icon" value="{$info.icon|default=''}" minlength="2"  class="form-control col-md-7 col-xs-12" placeholder="">
          </div>
        </div>
        <div class="item form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="url">权限URL <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12 ">
            <input type="text" id="url" name="url" value="{$info.url|default=''}" minlength="2"  class="form-control col-md-7 col-xs-12" placeholder="">
          </div>
        </div>
        <div class="item form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="code">权限说明 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12 ">
            <textarea id="code" name="code"   class="form-control col-md-7 col-xs-12" placeholder="">{$info.code|default=''}</textarea>
          </div>
        </div>
        <!--<div class="item form-group">-->
          <!--<label class="control-label col-md-3 col-sm-3 col-xs-12" for="sort">排序 <span class="required">*</span>-->
          <!--</label>-->
          <!--<div class="col-md-6 col-sm-6 col-xs-12 ">-->
            <!--<input type="number" id="sort" name="sort" value="{$info.sort|default='0'}" required class="form-control col-md-7 col-xs-12" placeholder="">-->
          <!--</div>-->
        <!--</div>-->
        {:html_sort('排序','sort',$info,100)}
        <div class="item form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12">状态 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12 ">
            <div class="col-md-6 col-sm-6 col-xs-12 ">
              <div class="radio icheck-turquoise" style="display: inline-block">
                <input type="radio"  {eq name="info.status|default='1'" value="1"}checked=""{/eq} id="turquoise1" name="status" value="1">
                <label for="turquoise1" >开启 </label>
              </div>
              <div class="radio icheck-turquoise" style="display: inline-block">
                <input type="radio"  {eq name="info.status|default=''" value="2"}checked=""{/eq}  id="turquoise2" name="status"  value="2">
                <label for="turquoise2">关闭</label>
              </div>
            </div>>
          </div>
        </div>




        <div class="ln_solid"></div>
        <div class="form-group">
          <div class="col-md-6 col-md-offset-3">
            <button id="send" type="submit" class="btn btn-success">提交</button>
            <div class="btn btn-primary" onclick="history.go(-1)">返回</div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

<script>
  var parent_id = $("[name='parent_id']").val();
  if(parent_id != 0){
      $("[name='icon']").parent().parent().hide(); //当前图片隐藏和取消验证
      $("[name='icon']").removeAttr('required');
  }
  $("[name='parent_id']").change(function(){

      var parent_id = $("[name='parent_id']").val();
      if(parent_id != 0){
          $("[name='icon']").parent().parent().hide();
          $("[name='icon']").removeAttr('required');
      }else{
          $("[name='icon']").parent().parent().show();
          $("[name='icon']").attr('required','required');
      }
  });
</script>